package fifthDemo;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class FifthTest {
    public static void main(String[] args) {
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
        Person person = (Person) beanFactory.getBean("chinese");
        person.eat();
        Person person1 = (Person) beanFactory.getBean("japan");
        person1.eat();
    }
}
